/**
 */
package net.hvacapp.cmvrfforandroid.utils;

/**
 * AndroidAnnotation找不到类解决方案
 *
 * @author hailong.han
 * @data 2014年9月20日
 * @time 下午6:14:49
 */
public class AnnotationUtil {
    /**
     * 适用于Activity
     *
     * @param clazz
     * @return
     */
    @SuppressWarnings("rawtypes")
    public static Class get(Class clazz) {

        if (clazz == null) {
            return null;
        }
        if (clazz.getCanonicalName().endsWith("_")) {
            return clazz;
        }

        String name = clazz.getCanonicalName() + "_";

        try {
            Class result = Class.forName(name);
            return result;
        } catch (ClassNotFoundException e) {
            throw new RuntimeException("Cannot find class for" + name, e);
        }

        //return null;
    }

//    public static IndexFragment getIndexFragment() {
//        IndexFragment indexFragment = new IndexFragment_();
//        return indexFragment;
//    }

}
